import 'package:flutter/material.dart';

import 'package:ycbl/widget/bl_app_bar.dart';


///首页
class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

/// 如果希望页面保存状态，重新进入时不重绘：
/// 1. 导航主页面需要使用 PageView or TabBarView
/// 2. 导航对应页面，需要 Mixins AutomaticKeepAliveClientMixin
/// 3. 实现 wantKeepAlive 返回 true
/// 4. 调用 super.build(context)
class _HomePageState extends State<HomePage>
    with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
  /// 希望页面保存状态，否则重新进入时 会重新初始化
  @override
  bool get wantKeepAlive => true;


  ///本页面widget
  Widget build(BuildContext context) {
    super.build(context);
    return Scaffold(
        appBar: AppBar(
          title: new Text("首页"),
        ),
        body: Center(
          child: Text("首页"),
        )
    );
  }
}
